package com.shensi.api.admin.client.system;

import com.shensi.api.admin.client.fallback.system.SysAgentFallBack;
import com.shensi.api.admin.domian.system.SysAgent;
import com.shensi.common.core.constant.CloudConstant;
import com.shensi.common.core.domain.AjaxResult;
import com.shensi.common.core.page.TableDataInfo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * @author: budian
 * @since: 2023/11/30
 */
@FeignClient(
        value = CloudConstant.ADMIN_SERVER,
        fallbackFactory = SysAgentFallBack.class)
@Component
public interface SysAgentClient {
    /**
     * 查询代理机构列表
     */
    @GetMapping("/list")
    public TableDataInfo list(@SpringQueryMap SysAgent sysAgent);
    /**
     * 导出代理机构列表
     */
    @GetMapping("/export")
    public AjaxResult export(@SpringQueryMap  SysAgent sysAgent);

    /**
     * 获取代理机构详细信息
     */
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Integer id);

    /**
     * 新增代理机构
     */
    @PostMapping("/addSysAgent")
    public AjaxResult addSysAgent(@RequestBody SysAgent sysAgent);

    /**
     * 查询代理已存在的
     */
    @GetMapping("/sysAgentlist")
    public AjaxResult sysAgentlist(@SpringQueryMap  SysAgent sysAgent);


    /**
     * 修改代理机构
     */
    @PutMapping
    public AjaxResult edit(@RequestBody SysAgent sysAgent);

    /**
     * 删除代理机构
     */
    @DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable("ids") Integer[] ids);

}
